<template>
  <div class="header">
    <div class="header-left">
      <el-button
        icon="el-icon-s-fold"
        size="mini"
        @click="handleMenu"
      />
      <el-breadcrumb separator-class="el-icon-arrow-right" class="text">
        <el-breadcrumb-item
          :to="{ path: item.path }"
          v-for="(item, index) in $route.matched"
          :key="index"
          >{{ item.meta.title }}
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="header-right">
      <el-dropdown trigger="click">
        <div class="imgs"><img src="../assets/img.jpg" /></div>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item icon="el-icon-postcard">个人中心</el-dropdown-item>
          <el-dropdown-item icon="el-icon-switch-button"
            >退出登录</el-dropdown-item
          >
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    handleMenu() {
      this.$store.commit("collapseMenu");
    },
  }
};
</script>

<style lang="less" scoped>
.header {
  display: flex;
  height: 60px;
  padding: 0 20px;
  justify-content: space-between;
  background-color: #282c34;
  align-items: center;
  .header-left {
     display: flex;
    align-items: center;
    justify-content: space-between;
    .text {
      color: #fff;
      font-size: 14px;
    }
    button {
      margin-right: 20px;
    }
     //deep样式穿刺
     /deep/.el-breadcrumb__item {
      .el-breadcrumb__inner {
        color: #fff;
      }
    }
  }
  .imgs {
    margin-right: 50px;
    img {
      width: 50px;
      height: 50px;
      border-radius: 50%;
    }
  }
}
</style>